package cn.itsource.ymcc.web.controller;

import cn.itsource.ymcc.dto.SMSSendDTO;
import cn.itsource.ymcc.result.JSONResult;
import cn.itsource.ymcc.service.IVerifyCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * @author Eric Chen
 * @since 2022/7/10
 */
@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {


    @Autowired
    private IVerifyCodeService verifyCodeService;

    //发送短信验证码
    @PostMapping("/sendSmsCode")
    public JSONResult sendSmsCode(@RequestBody @Valid SMSSendDTO dto){
        verifyCodeService.sendSmsCode(dto);
        return JSONResult.success();
    }



}
